# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1RuntimeCountersReport do
  @moduledoc """
  Runtime counters retrieved from CPU. Currently the runtime counters telemetry is only supported by Intel vPro PSR on Gen 14+.

  ## Attributes

  *   `enterHibernationCount` (*type:* `String.t`, *default:* `nil`) - Number of times that the device has entered into the hibernation state. Currently obtained via the PSR, count from S0->S4.
  *   `enterPoweroffCount` (*type:* `String.t`, *default:* `nil`) - Number of times that the device has entered into the power-off state. Currently obtained via the PSR, count from S0->S5.
  *   `enterSleepCount` (*type:* `String.t`, *default:* `nil`) - Number of times that the device has entered into the sleep state. Currently obtained via the PSR, count from S0->S3.
  *   `reportTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp when the report was collected.
  *   `uptimeRuntimeDuration` (*type:* `String.t`, *default:* `nil`) - Total lifetime runtime. Currently always S0 runtime from Intel vPro PSR.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :enterHibernationCount => String.t() | nil,
          :enterPoweroffCount => String.t() | nil,
          :enterSleepCount => String.t() | nil,
          :reportTime => DateTime.t() | nil,
          :uptimeRuntimeDuration => String.t() | nil
        }

  field(:enterHibernationCount)
  field(:enterPoweroffCount)
  field(:enterSleepCount)
  field(:reportTime, as: DateTime)
  field(:uptimeRuntimeDuration)
end

defimpl Poison.Decoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1RuntimeCountersReport do
  def decode(value, options) do
    GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1RuntimeCountersReport.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ChromeManagement.V1.Model.GoogleChromeManagementV1RuntimeCountersReport do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
